package com.becca.cake.service.users;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.web.multipart.MultipartFile;

import com.becca.cake.core.exception.ServiceException;
import com.becca.cake.model.system.AdminDO;
import com.becca.cake.model.users.UserCouponModel;
import com.becca.cake.model.users.UserFollowHolidayModel;
import com.becca.cake.model.users.UsersModel;

/**
 * 用户管理-用户查询service
 * 
 * @copyright  尊星(上海)信息科技有限公司
 * @author yellow
 * @date 2016年5月16日 下午11:25:59
 */
public interface IUserManagerService {
    /**
     * 用户查询
     * @param map
     * @return
     * @throws Exception
     */
    List<UsersModel> selectAllUsers(Map<String, Object> map) throws Exception;

    /**
     * 取每页总条数
     * @param map
     * @return
     * @throws Exception
     */
    Long selectAllUsersCount(Map<String, Object> map) throws Exception;

    /**
     * 添加或修改用户信息
     * @param usersModel
     * @throws DataAccessException
     */
    void insertOrUpdateUser(UsersModel usersModel) throws Exception;

    /**
     * 删除用户
     * @param id
     * @throws DataAccessException
     */
    void deleteUserById(String id) throws Exception;

    /**
     * 添加或修改用户
     * @param usersModel
     * @param files
     * @param fileTempPath
     * @param adminDo
     * @throws Exception
     */
    void addOrUpdateUser(UsersModel usersModel, MultipartFile files, String fileTempPath,
                         AdminDO adminDo) throws Exception;

    /**
     * 校验手机号是否存在
     * @param mobileNo
     * @throws Exception
     */
    String valideMobileIsExist(String mobileNo) throws Exception;

    /**
     *  查询用户优惠券
     * @param map
     * @return
     * @throws ServiceException
     */
    List<UserCouponModel> selectUserCouponsByMobileNo(Map<String, Object> map)
                                                                              throws ServiceException;

    /**
     * 获取查询用户优惠券总数
     * @param map
     * @return
     * @throws ServiceException
     */
    Long selectUserCouponsByMobileNoCount(Map<String, Object> map) throws ServiceException;

    /**
     *  查询节日假期
     * @param map
     * @return
     * @throws ServiceException
     */
    List<UserFollowHolidayModel> selectFollowHolidays(Map<String, Object> map)
                                                                              throws ServiceException;

    /**
     * 获取节日假期总是
     * @param map
     * @return
     * @throws ServiceException
     */
    Long selectFollowHolidaysCount(Map<String, Object> map) throws ServiceException;

    /**
     * 根据id查询用户对象
     * @param userId
     * @return
     * @throws ServiceException
     */
    UsersModel selectUserById(Integer userId) throws ServiceException;

    /**
     * 启用/禁用
     * @param id
     * @throws ServiceException
     */
    void updUserStatusById(String userId,String status,String userName) throws ServiceException;

    /**
     * 根据手机号查询用户
     * @param selectUserByMobileNo
     * @return
     * @throws DataAccessException
     */
    UsersModel selectUserByMobileNo(String mobileNo) throws ServiceException;

    /**
     * 统计用户 显示图表
     * @return
     * @throws ServiceException
     */
    List<UsersModel> selectUserChart(String days, String userChartStartDate, String userChartEndDate)
                                                                                                     throws ServiceException;
}
